package org.practice.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * Hibernate注解是ejb3注解的自然扩展,对JPA的增强
 * @author jack
 */
@Entity//默认映射该类所有的属性到数据库
@Table(name="shop_user")
public class User implements java.io.Serializable{
	private static final long serialVersionUID=123456l;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)//指定生成器的策略
	//@GeneratedValue(generator = "system-uuid")//指定生成器的名称
	//@GenericGenerator(name = "system-uuid", strategy = "uuid.hex")//为指定的生成器配置hibernate提供的主键生成策略strategy="uuid.string",strategy="increment"
	private Integer id;
	
	private Boolean status=Boolean.TRUE;// 记录状态 0 无效，1 有效 

	private String email;
	
	private String nickname;

	private String password;

	@Column(name="user_integral")
	private Integer integral;
	
	@Column(name="is_email_verify")
	private boolean verify;

	@Column(name="email_verify_code")
	private String verifyCode;

	@Column(name="last_login_time")
	private long lastLogin;

	@Column(name="last_login_ip")
	private String lastIp;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getIntegral() {
		return integral;
	}

	public void setIntegral(Integer integral) {
		this.integral = integral;
	}

	public boolean isVerify() {
		return verify;
	}

	public void setVerify(boolean verify) {
		this.verify = verify;
	}

	public String getVerifyCode() {
		return verifyCode;
	}

	public void setVerifyCode(String verifyCode) {
		this.verifyCode = verifyCode;
	}

	public long getLastLogin() {
		return lastLogin;
	}

	public void setLastLogin(long lastLogin) {
		this.lastLogin = lastLogin;
	}

	public String getLastIp() {
		return lastIp;
	}

	public void setLastIp(String lastIp) {
		this.lastIp = lastIp;
	}

	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

}
